<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script>
    var num = 10;
    function fn(){
        console.log(num);
        result = 20;
    }
    fn();
    console.log(result);
    var a = 1
    function func() {
        a = b = 2
    }
    func()
    alert(a)
    alert(b)
</script>
</body>
</html>